<template>
	<view style="background-color: #f7f7f7;">
		<!-- 顶部蓝色背景 -->
		<view class="topimage">
			<!-- 顶部栏 -->
			<view class="title">
				<image src="../../../static/车联网服务-08我的-05我的车辆添加_slices/箭头.png" @click="back"></image>
				<view style="margin-left: 250rpx;">加油详情</view>
			</view>
		</view>
		
		<!-- <view class="topLan">
			<view class="left" @click="back"><u-icon name="arrow-left" color="white" size="23"></u-icon></view>
			<view class="middle" style="font-size: 18px;color: white;">洗车</view>
		</view> -->
		<!-- 上部主体部分 -->
		<view class="topzhuti">
			<!-- 上部图片 -->
			<view style="margin: 0 auto;"><image class="image1" :src="jiaYouZhan.image"></image></view>
			
			<!-- 下部文本部分 -->
			<view class="text">
			<view class="text1">{{jiaYouZhan.name}}</view>
			<view class="text2">{{jiaYouZhan.yingYeTime}}</view>
			<view class="text3">{{jiaYouZhan.address}}<image class="image2" src="../../../static/车联网服务-05就近加油-03门店详情_slices/plane@3x.png"></image></view>
			<view><image class="image3" src="../../../static/车联网服务-05就近加油-03门店详情_slices/电话图片_17.png"></image></view>
			</view>
		</view>
		<!-- 下部主体部分 油价详情 -->
		<view class="bottomzhuti">
			<view class="text4">油价详情</view>
			<view class="waibu">
				<view class="xunhuan" v-for="(item,index) in jiaYouZhan.oilPrices" :key="index">
					<view class="wenzi">
					<text style="font-size: 14px;">{{item.grade}}</text>
					<text style="font-size: 14px;color: #ffa02b;">￥{{item.price}}/L</text>
					</view>
					<view class="underline" v-if="index !== jiaYouZhan.oilPrices.length - 1"></view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
				jiaYouZhan:{
					name:"中国石油加油站（解放路店）",
					yingYeTime:"营业时间：周一至周五 早上8:00-晚上22:00",
					address:"位置:山阳区人民路与解放路交叉口",
					image:"../../../static/车联网服务-05就近加油-03门店详情_slices/加油站图片3432_17.jpg",
					oilPrices:[
					{grade:"92#",price:5.86},
					{grade:"95#",price:5.86},
					{grade:"98#",price:5.86},
					{grade:"0#",price:5.86}
				],
				}
			}
		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			 async fetchJiaYouZhanData() {
			      try {
			        const response = await uni.request({
			          url: '',
			          method: 'GET'
			        });
			        if (response[1].statusCode === 200) {
			          this.jiaYouZhan = response[1].data;
			        }
			      } catch (error) {
			        console.error("数据加载失败:", error);
			      }
			    }
			  },
			  mounted() {
			    // this.fetchJiaYouZhanData();  //页面加载时获取数据
			  },
			  onShow(){
				  console.log(this.jiaYouZhan);  //打印数据结构
			  }
	}
</script>

<style lang="scss">
	.title {
		
		background-repeat: no-repeat;
		background-size: 100% 100%;
		height: 300rpx;
		display: flex;
		padding: 60rpx 300rpx 40rpx 30rpx;
		justify-content: space-between;
	
		image {
			color: white;
			width: 35rpx;
			height: 35rpx;
		}
	
		view {
			color: white;
		}
	}
	
	
	
	
	.topimage{
		display: flex;
		width: 100%;
		height: 430rpx;
		background-color: #3183fc;
	}
	// .topLan{
	// 	width: 100%;
	// 	display: flex;
	// 	position: absolute;
	// 	top: 60rpx;
	// 	justify-content: center;
	// 	align-items: center;
	// }
	// .left{
	// 	position: absolute;
	// 	left: 10rpx;	
	// }
	.topzhuti{
		background-color: white;
		width: 90%;
		// height: 654rpx;
		margin: 0 auto;
		margin-top: -280rpx;
		text-align: center;
		border-radius: 10px;
		padding-bottom: 16rpx;
	}
	.image1{
		border-radius: 12px;
		width: 91%;
		height: 424rpx;
		margin-top: 30rpx;
	}
	.text{
		margin-top: 90rpx;
		width: 91%;
		text-align: left;
		margin: 24rpx auto;
		position: relative;
	}
	.text1{
		font-size: 15px;
		font-weight: 600;
	}
	.text2{
		font-size: 11px;
		margin: 20rpx 0 14rpx 0;
	}
	.text3{
		font-size: 11px;
	}
	.image2{
		width: 26rpx;
		height: 28rpx;
		margin-left: 20rpx;
	}
	.image3{
		width: 108rpx;
		height: 96rpx;
		position: absolute;
		right: 10rpx;
		top: 30rpx
	}
	.bottomzhuti{
		background-color: white;
		width: 90%;
		// height: 654rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		// text-align: center;
		border-radius: 10px;
		position: relative;
		padding-top: 30rpx;
		padding-bottom: 40rpx;
	}
	.text4{
		font-size: 16px;
		// position: absolute;
		// top: 30rpx;
		// margin-top: 30rpx;
		margin-left: 28rpx;
	}
	.waibu{
		width: 100%;
		// position: absolute;
		// top: 90rpx;
		margin-top: 30rpx;
		text-align: center;
	}
	.wenzi{
		width: 100%;
		display: flex;
		justify-content: space-around;
	}
	.underline{
		display: flex;
		border-bottom: 1px solid #ebf0f0;
		width: 90%;
		margin: 0 auto;
		margin-bottom: 20rpx;
		margin-top: 20rpx;
	}
</style>
